package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *规章制度
 *InfRule. @author hond
 */
@Entity
@Table(name = "INF_RULE")//规章制度
public class InfRule implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	protected Long id; 
	private String title;       //制度标题
	private String keyword;     //关键字
	private String content;     //制度内容
	private Date createtime;    //发布时间
	private Integer issms;      //是否短信提示：1是2否
	private Integer isims;      //是否短消息提示：1是2否
	private String annexurl;    //附件地址
	private Integer readtimes;  //查阅次数
	private String reader;      //查阅人员姓名
	private Integer peoplecount;//查阅人数
	private Integer status;        //制度状态
	private InfType type;       //制度类型
	private SysEmployee user;     //发布人
	private SysDept dept;       //发布部门

	// Constructors

	/** default constructor */
	public InfRule() {
	}

	 @Id
	 @Column(name = "ID", unique = true, nullable = false)
	 @SequenceGenerator(name="SQ_INFRULE_ID",sequenceName="SQ_INFRULE_ID",allocationSize=1)
     @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_INFRULE_ID")
	 public Long getId() {
	    return id;
	 }

	 public void setId(Long id){
	    this.id = id;
	 }
	
	@Column(name = "TITLE", length = 60)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "KEYWORD", length = 40)
	public String getKeyword() {
		return this.keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	@Column(name = "CONTENT")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATETIME", length = 7)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Column(name = "ISSMS", precision = 1, scale = 0)
	public Integer getIssms() {
		return this.issms;
	}

	public void setIssms(Integer issms) {
		this.issms = issms;
	}

	@Column(name = "ISIMS", precision = 1, scale = 0)
	public Integer getIsims() {
		return this.isims;
	}

	public void setIsims(Integer isims) {
		this.isims = isims;
	}

	@Column(name = "ANNEXURL", length = 100)
	public String getAnnexurl() {
		return this.annexurl;
	}

	public void setAnnexurl(String annexurl) {
		this.annexurl = annexurl;
	}

	@Column(name = "READTIMES", precision = 5, scale = 0)
	public Integer getReadtimes() {
		return this.readtimes;
	}

	public void setReadtimes(Integer readtimes) {
		this.readtimes = readtimes;
	}

	@Column(name = "READER", length = 4000)
	public String getReader() {
		return this.reader;
	}

	public void setReader(String reader) {
		this.reader = reader;
	}

	@Column(name = "PEOPLECOUNT", precision = 5, scale = 0)
	public Integer getPeoplecount() {
		return this.peoplecount;
	}

	public void setPeoplecount(Integer peoplecount) {
		this.peoplecount = peoplecount;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "TYPE_ID")
	public InfType getType() {
		return this.type;
	}

	public void setType(InfType type) {
		this.type = type;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "DEPT_ID")
	public SysDept getDept() {
		return this.dept;
	}

	public void setDept(SysDept dept) {
		this.dept = dept;
	}

}